import Vue from 'vue'
import VueRouter from 'vue-router'
import LoginView from "@/views/LoginView.vue";
import AdminView from "@/views/AdminView.vue";
import RegisterVIew from "@/views/RegisterVIew.vue";
import OurClassView from '@/views/OurClassView.vue';
import HomeView from '@/views/HomeView.vue';
import StudentsView from "@/views/StudentsView.vue";
import CollRollView from "@/views/CollRollView.vue";
import StudentsDataView from "@/views/StudentsDataView.vue";


Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'login',
        component: LoginView
    },
    {
        path: '/register',
        name: 'register',
        component: RegisterVIew
    },
    {
        path: '/admin',
        name: 'admin',
        component: AdminView,
        children: [
            {
                path: '',
                name: 'home',
                component: HomeView
            },
            {
                path: 'ourclass',
                name: 'ourclass',
                component: OurClassView
            },
            {
                path: 'students',
                name: 'students',
                component: StudentsView
            }, {
                path: 'collroll',
                name: 'collroll ',
                component: CollRollView
            }, {
                path: 'studentsData',
                name: 'studentsData',
                component: StudentsDataView
            }
        ]
    },

]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})


export default router
